package crm.model;

import java.sql.*;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;

import crm.dbcoon.DBConnect;

public class Product_system_stage {
	public static HashMap getAllProductSystemStage() {
		DBConnect dbc=new DBConnect();
		ResultSet rs=null;
		HashMap stages=new HashMap();
		String sql="select * from product_system";
		dbc.prepareStatement(sql);
		try {
			rs=dbc.executeQuery();
			while (rs.next()) {
				int id=rs.getInt("id");
				String system_name=rs.getString("system_name");
				stages.put(id, system_name);
			}
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
		}finally{
			dbc.close();
		}
		return stages;
	}
	
	
	public static void main(String args[]){
		HashMap alist=getAllProductSystemStage();
		Iterator iterator=alist.entrySet().iterator();
		while(iterator.hasNext()){
			Map.Entry entry=(Map.Entry) iterator.next();
			System.out.println(entry.getKey()+"sss"+entry.getValue());
		}
	}

}
